Optimal. Leaf size=150 \[ \frac {(a-i b)^{3/2} (i A+B) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{d}-\frac {(a+i b)^{3/2} (i A-B) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{d}-\frac {2 (A b+a B) \sqrt {a+b \cot (c+d x)}}{d}-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 5, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3609, 3620,
3618, 65, 214} \begin {gather*} -\frac {2 (a B+A b) \sqrt {a+b \cot (c+d x)}}{d}+\frac {(a-i b)^{3/2} (B+i A) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{d}-\frac {(a+i b)^{3/2} (-B+i A) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{d}-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3609
Rule 3618
Rule 3620
Rubi steps
\begin {align*} \int (a+b \cot (c+d x))^{3/2} (A+B \cot (c+d x)) \, dx &=-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d}+\int \sqrt {a+b \cot (c+d x)} (a A-b B+(A b+a B) \cot (c+d x)) \, dx\\ &=-\frac {2 (A b+a B) \sqrt {a+b \cot (c+d x)}}{d}-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d}+\int \frac {a^2 A-A b^2-2 a b B+\left (2 a A b+a^2 B-b^2 B\right ) \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx\\ &=-\frac {2 (A b+a B) \sqrt {a+b \cot (c+d x)}}{d}-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {1}{2} \left ((a-i b)^2 (A-i B)\right ) \int \frac {1+i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx+\frac {1}{2} \left ((a+i b)^2 (A+i B)\right ) \int \frac {1-i \cot (c+d x)}{\sqrt {a+b \cot (c+d x)}} \, dx\\ &=-\frac {2 (A b+a B) \sqrt {a+b \cot (c+d x)}}{d}-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {\left ((a+i b)^2 (i A-B)\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a+i b x}} \, dx,x,-i \cot (c+d x)\right )}{2 d}-\frac {\left ((a-i b)^2 (i A+B)\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {a-i b x}} \, dx,x,i \cot (c+d x)\right )}{2 d}\\ &=-\frac {2 (A b+a B) \sqrt {a+b \cot (c+d x)}}{d}-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d}+\frac {\left ((a-i b)^2 (A-i B)\right ) \text {Subst}\left (\int \frac {1}{-1-\frac {i a}{b}+\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{b d}+\frac {\left ((a+i b)^2 (A+i B)\right ) \text {Subst}\left (\int \frac {1}{-1+\frac {i a}{b}-\frac {i x^2}{b}} \, dx,x,\sqrt {a+b \cot (c+d x)}\right )}{b d}\\ &=\frac {(a-i b)^{3/2} (i A+B) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-i b}}\right )}{d}-\frac {(a+i b)^{3/2} (i A-B) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+i b}}\right )}{d}-\frac {2 (A b+a B) \sqrt {a+b \cot (c+d x)}}{d}-\frac {2 B (a+b \cot (c+d x))^{3/2}}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.01, size = 294, normalized size = 1.96 \begin {gather*} -\frac {\frac {3 \sqrt {a-\sqrt {-b^2}} \left (-2 a b \left (A \sqrt {-b^2}+b B\right )+a^2 \left (A b-\sqrt {-b^2} B\right )+b^2 \left (-A b+\sqrt {-b^2} B\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a-\sqrt {-b^2}}}\right )}{b^2+a \sqrt {-b^2}}+\frac {3 \left (2 a b \left (-A \sqrt {-b^2}+b B\right )-a^2 \left (A b+\sqrt {-b^2} B\right )+b^2 \left (A b+\sqrt {-b^2} B\right )\right ) \tanh ^{-1}\left (\frac {\sqrt {a+b \cot (c+d x)}}{\sqrt {a+\sqrt {-b^2}}}\right )}{\sqrt {-b^2} \sqrt {a+\sqrt {-b^2}}}+6 (A b+a B) \sqrt {a+b \cot (c+d x)}+2 B (a+b \cot (c+d x))^{3/2}}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(919\) vs.
\(2(126)=252\).
time = 0.66, size = 920, normalized size = 6.13
method | result | size |
derivativedivides | \(\frac {-\frac {2 B \left (a +b \cot \left (d x +c \right )\right )^{\frac {3}{2}}}{3}-2 A b \sqrt {a +b \cot \left (d x +c \right )}-2 B a \sqrt {a +b \cot \left (d x +c \right )}-\frac {\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-2 A \sqrt {a^{2}+b^{2}}\, b^{2}-2 B \sqrt {a^{2}+b^{2}}\, a b -\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{2 b}-\frac {-\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (2 A \sqrt {a^{2}+b^{2}}\, b^{2}+2 B \sqrt {a^{2}+b^{2}}\, a b +\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{2 b}}{d}\) | \(920\) |
default | \(\frac {-\frac {2 B \left (a +b \cot \left (d x +c \right )\right )^{\frac {3}{2}}}{3}-2 A b \sqrt {a +b \cot \left (d x +c \right )}-2 B a \sqrt {a +b \cot \left (d x +c \right )}-\frac {\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \ln \left (b \cot \left (d x +c \right )+a +\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}+\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (-2 A \sqrt {a^{2}+b^{2}}\, b^{2}-2 B \sqrt {a^{2}+b^{2}}\, a b -\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {2 \sqrt {a +b \cot \left (d x +c \right )}+\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{2 b}-\frac {-\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \ln \left (\sqrt {a +b \cot \left (d x +c \right )}\, \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-b \cot \left (d x +c \right )-a -\sqrt {a^{2}+b^{2}}\right )}{2}+\frac {2 \left (2 A \sqrt {a^{2}+b^{2}}\, b^{2}+2 B \sqrt {a^{2}+b^{2}}\, a b +\frac {\left (-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, a +A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a^{2}-A \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, b^{2}+B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, \sqrt {a^{2}+b^{2}}\, b -2 B \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}\, a b \right ) \sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}}{2}\right ) \arctan \left (\frac {\sqrt {2 \sqrt {a^{2}+b^{2}}+2 a}-2 \sqrt {a +b \cot \left (d x +c \right )}}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}\right )}{\sqrt {2 \sqrt {a^{2}+b^{2}}-2 a}}}{2 b}}{d}\) | \(920\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + B \cot {\left (c + d x \right )}\right ) \left (a + b \cot {\left (c + d x \right )}\right )^{\frac {3}{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 13.76, size = 2823, normalized size = 18.82 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________